package quadtreetest 
{
	import flash.display.Sprite;
	import flash.geom.Rectangle;
	import iscript.coreFramework.displays.drawing.LineSegment;
	import iscript.gameFramework.GameLite.math.RectangleIncision;
	import iscript.gameFramework.GameLite.math.RectangleIncisionNode;
	public class QuadTreeMain extends Sprite
	{
		
		private var index:int = 0;
		public function QuadTreeMain() 
		{
				stage.scaleMode="noScale";
			stage.align="TL";
			
			var rect:Rectangle = new Rectangle(0, 0, 1200, 800);
			var ri:RectangleIncision = new RectangleIncision(rect);
			var rectList:Vector.<RectangleIncisionNode> = ri.slice(2, 2);
			
			var line:LineSegment = new LineSegment();
			line.thickness = 1;
			
			
			for each (var item:RectangleIncisionNode in rectList) 
			{
				line.lineColor = 0x000000
				line.drawRectangle(this.graphics, item.rect);
				
				
				/*var rects:Vector.<RectangleIncisionNode> = new RectangleIncision(item.rect).slice(2, 2);
				   for each ( var itemNode:RectangleIncisionNode in rects) {
					   line.lineColor = 0xFF0080;
					   line.drawRectangle(this.graphics, itemNode.rect);
					      
					   
					     var rects3:Vector.<RectangleIncisionNode> = new RectangleIncision(itemNode.rect).slice(2, 2);
					     for each ( var itemNode3:RectangleIncisionNode in rects3) {
					      	   line.lineColor = 0xFFFF00;
								line.drawRectangle(this.graphics, itemNode3.rect);
						   }
					 }*/
			}
			
		}
		
		private function  slice():void {
			    
			    
			   
			}
		
		
		
		
		
		
		
	}

}